saga2edit manual: Tile Maps

Tile Maps

Tile maps in Final Fantasy Legend II are encoded as sequences of drawing commands. Saga2edit does not attempt to hide this. Theoretically, arbitrary tile map data could be encoded in this way, but content that isn't designed for this system is likely to take a lot of storage space. Instead, saga2edit exposes direct access to the drawing commands.

The list of drawing commands is displayed on the right side of the main window. Selecting a command in this window will show the result of all the commands up to and including the selected command. New commands will be inserted after the selected command (and new commands will be automatically selected).

There are two cursors. Many drawing commands use the position of the default cursor (called "p" for "position" in the command listing). Saga2edit indicates the position of the default cursor with a blue square outlining the tile. Saga2edit will automatically create commands to move the default cursor when needed, but the author should be aware to group together commands that use the same cursor position. Also, be aware of these extra cursor commands when deleting commands.

There is also a line cursor (called "l" in the command listing). The line drawing command automatically sets the position of the line cursor to the end of the line. Line drawing commands can start from either the default cursor or the line cursor. (Saga2edit will handle this choice automatically.) The current position of the line cursor is indicated with a red square outlining the tile.

The tiles that are placed by the drawing commands are controlled by the tile palette which is shown at the top of the main window. Two tiles can be selected (although some drawing commands only use one). The first tile is selected by a left click and is indicated by a blue outline. The second tile is selected by a right click and is indicated by a red outline. Sometimes it will also make sense to select the same tile in both slots, and this make take fewer bytes to encode. When a command uses two tiles, saga2edit will ensure that the tile selected in the first slot is the one that appear in the tile that was clicked to initiate the command.

The bottom half of the tile palette contains another copy of the tileset highlighted in gold. These versions of the tiles are the "inside" versions for the purposes of inside/outside transitions. (For example, entering the second room in the starting cave is a transition from outside to inside.)

The game references tile maps by their address. Saga2edit numbers them sequentially, but if you delete a tile map, they may be renumbered the next time you open the file. Because they are referenced by address, there is no index limit. However, the space allocated for tile maps is limited. Saga2edit displays a tile map size report at the bottom of the main window. Because tile maps are split between two ROM banks, the evaluation of available space might not be completely intuitive. At this time, saga2edit just stores the tile maps in order without trying to pack them efficiently.

Tile map addresses are not stored in the game save files, so changing tile maps won't necessarily break saves. (Of course, changes to the tile maps themselves may cause their own problems.)

Tile Command

The tile command puts one tile at any position. This command takes three bytes, and does not use the cursor.

Line Command

To place a line, click the starting position and drag to the ending position. This will create a line of tiles. It will alternate between the two selected tiles.

A line can start from the default cursor or the line cursor. The line cursor will always be moved to the end of the line. (Lines that start at the default cursor or line cursor are internally different commands, but saga2edit manages this automatically.)

Line commands take three or four bytes depending on whether two different tiles are used. If the default cursor has to be moved, it will take two additional bytes.

Rectangle (Outline) Command

To place a rectangle outline, click one corner and drag to the opposite corner. It will alternate between the two selected tiles.

Rectangle outline commands take three or four bytes depending on whether two different tiles are used. The command always starts from the default cursor, so it will take two additional bytes if the default cursor has to be moved.

Rectangle (Filled) Command

To place a filled rectangle, click on corner and drag to the opposite corner. It will alternate between the two selected tiles in a checkerboard pattern.

Filled rectangle commands take three or four bytes depending on whether two different tiles are used. The command always starts from the default cursor, so it will take two additional bytes if the default cursor has to be moved.

Circle Command

To place a circle, click on the center of the circle and drag to the edge. Only one tile will be used. Small circles are calculated using a look-up table, so their behavior is stable. Larger circles are calculated dynamically, so their exact appearance will fluctuate depending on exactly which edge tile is selected (but, saga2edit should accurately predict the game's behavior).

Circle commands take three bytes. The center of the circle is at the default cursor, so it will take two additional bytes if the default cursor has to be moved.

Flood Command

The flood command is a not a true flood fill. The flood will affect the selected tile, and all contiguous matching tiles in the same column. Then, for each of those tiles, it will also affect all contiguous matching tiles in each of those rows. However, it will not recurse further. Only one tile will be used.

This command takes two bytes. The starting point is at the default cursor, so it will take two additional bytes if the default cursor has to be moved.

Clear Command

The clear command fills the whole 64 by 64 grid with the selected tiles in a checkerboard pattern. This command always takes two bytes (regardless of whether it uses one or two tiles), and it doesn't use the cursor. Conventionally, each tile map starts with this command.

Trigger Command

This is not a drawing command. Clicking on a (green-highlighted) trigger tile with this tool selected will open the trigger editor to the corresponding trigger.

NPC Command

This is not a drawing command. Clicking on a (blue-highlighted) NPC with this tool will open the NPC editor to the corresponding NPC.

Conditions

Conditions are special commands that allow a map to change based on the value of script variables. A condition indicates a script variable, and minimum and maximum values. If the value of the script variable is not between the given limits (inclusive), tile map drawing will stop at the condition command.

Note that changing a script variable will not cause the currently loaded tile map to be changed immediately. Changes will be detected when entering a map, when returning from battle, or when the map is explicitly refreshed by a script.